Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add close option for HTTPContext.Request().SetBody method #502

Merged
merged 2 commits into from
Feb 10, 2022
Merged

add close option for HTTPContext.Request().SetBody method #502

merged 2 commits into from
Feb 10, 2022

Conversation

suchen-sci
Copy link
Contributor

The request body in HTTPContext can be io.Reader or io.ReadCloser, but when we call SetBody method in HTTPContext.Request, it only replace the reader and not close previous reader.

This pr fix this issue by adding a flag to SetBody method. For now, except the case of PrimarySecondaryReader, all other cases will close previous reader when set new reader.

@samutamm samutamm changed the title add close option for HTTPContext.Reqeust().SetBody method add close option for HTTPContext.Request().SetBody method Feb 10, 2022
@suchen-sci suchen-sci merged commit a99ec2d into easegress-io:main Feb 10, 2022
@suchen-sci suchen-sci deleted the request-setbody branch February 10, 2022 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants